package com.gjzt.business.media.controller;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eastdigit.servlet.ReqBean;
import com.eastdigit.servlet.RequestAttribute;
import com.eastdigit.servlet.Response;
import com.gjzt.business.media.service.ScheduleService;

@Controller
@RequestMapping(value = "/schedule")
public class ScheduleController {

    @Autowired
    private ScheduleService scheduleService;

    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/query")
    @ResponseBody
    public JSONObject queryMediaBus(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
    	
        return Response.response(scheduleService.findSchedule(reqBean));
    }


    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/queryBillSources")
    @ResponseBody
    public JSONObject queryBillSources(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {

        return Response.response(scheduleService.queryBillSources(reqBean));
    }

    
    /**
     * 查询上刊单资源明细
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/queryBillResource")
    @ResponseBody
    public JSONObject queryBillResource(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(scheduleService.queryBillResource(reqBean));
    }
    
    
    /**
     * 查询上刊单资源明细
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/getResourceHistory")
    @ResponseBody
    public JSONObject getResourceHistory(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(scheduleService.getResourceHistory(reqBean));
    }
    
}